package com.rabbitmq.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author lipengwei
 */
@Component
public class WorkCustomer {

    /**
     * 一个消费者
     * @param message 消息
     */
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel(String message) {
        System.out.println("message1 == " + message);
    }

    /**
     * 一个消费者
     * @param message 消息
     */
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel2(String message) {
        System.out.println("message2 == " + message);
    }
}
